/**
 * Created by lizhe on 2018/4/16.
 */
var datas = [];
var first = [];
var second = [];
var third = [];

var menuId = 0;
var type = "";
var next = "";
$(document).ready(function(){
    menuId = getQueryString("menuId");
    type = getQueryString("type");
    next = getQueryString("next");
    queryList2(menuId);
    queryAlbum(1,100000,menuId);
});


function queryAlbum(page,pageSize,menuId){
    $.ajax({
        url : urladdr + "/web/article/list",
        method : "GET",
        data : {
            page:page,
            pageSize:pageSize,
            menuId:menuId,
            status:2
        },
        success : function(data){
            if(data.code == 0){
                $("#content").empty();
                if(data.data.list.length!=0){
                    $.each(data.data.list,function(i,date){
                        var icon = imgUrl + date.imageUrl;
                        document.getElementById("content").innerHTML = document.getElementById("content").innerHTML +
                            '<div class="DivContent" onclick=toInfo("'+date.id+'")>'+
                            '<div class="imgDiv">'+
                            '<img src="'+icon+'" class="schoolImg">'+
                            '</div>'+
                            '<div class="imgTitleDiv">'+
                            '<span class="imgTitle">'+date.title+'</span>'+
                            '</div>'+
                            '</div>'
                    });
                }else{

                }
            }else if(data.code == 401){
                location.href = "index.html"
            }else{
                modalinfo(data.msg);
            }
        }
    });
}

function toInfo(id){
    location.href = "text.html?menuId="+menuId + "&id="+id+"&next="+next;
}

